import Vue from "vue"
//引入路由
import vueRouter from "vue-router"

//注册使用路由
Vue.use(vueRouter)


import index from "@/components/index"
import login from "@/components/user/login"
import userAdmin from "@/components/user/admin"
import userRegister from "@/components/user/register"
import userAdd from "@/components/user/add"

export default new vueRouter({
	mode: "history", //去掉#号
	routes: [{
			path: "/",
			component: index,
			meta: {
				title: '首页'
			},
			children: [
				//配置用户添加渲染出口在index组件中
				{
				path: "userAdmin/add",
				component: userAdd,
				meta: {
					title: '用户添加'
				}
			}]

		},
		{
			path: "/user/register",
			component: userRegister,
			meta: {
				title: '用户注册'
			}
		},
		// 渲染在顶级出口
		{
			path: "/user/login1",
			component: login,
			meta: {
				title: '登录'
			}
		},
		//渲染在userAdmin 组件中
		{
			path: "/user",
			component: userAdmin,
			children: [{
				path: "login",
				component: login,
				meta: {
					title: '登录页面'
				}
			}]

		}


	]
})
